package org.bean;

import java.util.Date;
import java.util.List;

import org.constant.ActionEnum;

import com.google.common.collect.Lists;

/**
 * @author : DengYing
 * @CreateDate : 2017年11月8日 下午6:52:38
 * @Description ：商城刷新信息
 */
public class StoreInfo {
	List<UpdateStore> updateStores = Lists.newArrayList();
	List<UpdateCommodity> updateCommoditys = Lists.newArrayList();
	List<ServerLimit> serverLimits = Lists.newArrayList();
	private ActionEnum action;
	
	
	public StoreInfo(ActionEnum action) {
		super();
		this.action = action;
	}



	public boolean isEmpty(){
		if (updateStores.isEmpty() && updateCommoditys.isEmpty() && serverLimits.isEmpty()) {
			return true;
		}else {
			return false;
		}
	}




	public ActionEnum getAction() {
		return action;
	}



	public void setAction(ActionEnum action) {
		this.action = action;
	}


	public List<UpdateStore> getUpdateStores() {
		return updateStores;
	}



	public List<UpdateCommodity> getUpdateCommoditys() {
		return updateCommoditys;
	}



	public List<ServerLimit> getServerLimits() {
		return serverLimits;
	}

	
	public static class UpdateStore{
		private int id;
		private Date lastRefreshDate;
		private Date nextRefreshDate;
		public UpdateStore(int id, Date lastRefreshDate, Date nextRefreshDate) {
			super();
			this.id = id;
			this.lastRefreshDate = lastRefreshDate;
			this.nextRefreshDate = nextRefreshDate;
		}
		public int getId() {
			return id;
		}
		public void setId(int id) {
			this.id = id;
		}
		public Date getLastRefreshDate() {
			return lastRefreshDate;
		}
		public void setLastRefreshDate(Date lastRefreshDate) {
			this.lastRefreshDate = lastRefreshDate;
		}
		public Date getNextRefreshDate() {
			return nextRefreshDate;
		}
		public void setNextRefreshDate(Date nextRefreshDate) {
			this.nextRefreshDate = nextRefreshDate;
		}
		
	}
	
	public static class UpdateCommodity{
		private int id;
		private Date lastRefreshDate;
		private Date nextRefreshDate;
		
		public UpdateCommodity(int id, Date lastRefreshDate, Date nextRefreshDate) {
			super();
			this.id = id;
			this.lastRefreshDate = lastRefreshDate;
			this.nextRefreshDate = nextRefreshDate;
		}

		public int getId() {
			return id;
		}

		public void setId(int id) {
			this.id = id;
		}

		public Date getLastRefreshDate() {
			return lastRefreshDate;
		}

		public void setLastRefreshDate(Date lastRefreshDate) {
			this.lastRefreshDate = lastRefreshDate;
		}

		public Date getNextRefreshDate() {
			return nextRefreshDate;
		}

		public void setNextRefreshDate(Date nextRefreshDate) {
			this.nextRefreshDate = nextRefreshDate;
		}
	}
	
	public static class ServerLimit{
		/**
		* 商品ID
		*/
		private int commodityId;
		
		/**
		* 当前阶段购买数量
		*/
		private int nowBuyCount;
		
		/**
		* 总购买数量
		*/
		private int totalBuyCount;

		public ServerLimit(int commodityId, int nowBuyCount, int totalBuyCount) {
			super();
			this.commodityId = commodityId;
			this.nowBuyCount = nowBuyCount;
			this.totalBuyCount = totalBuyCount;
		}

		public int getCommodityId() {
			return commodityId;
		}

		public void setCommodityId(int commodityId) {
			this.commodityId = commodityId;
		}

		public int getNowBuyCount() {
			return nowBuyCount;
		}

		public void setNowBuyCount(int nowBuyCount) {
			this.nowBuyCount = nowBuyCount;
		}

		public int getTotalBuyCount() {
			return totalBuyCount;
		}

		public void setTotalBuyCount(int totalBuyCount) {
			this.totalBuyCount = totalBuyCount;
		}
		
		
	}
}
